# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=py3-pytest-httpx
pkgver=0.21.0
pkgrel=0
pkgdesc="send responses to httpx"
url="https://colin-b.github.io/pytest_httpx/"
arch="all !armhf !ppc64le" #limited by py3-httpx
license="MIT"
depends="py3-httpx py3-pytest"
makedepends="py3-build py3-installer py3-setuptools py3-wheel"
checkdepends="py3-pytest-asyncio"
source="$pkgname-$pkgver.tar.gz::https://github.com/Colin-b/pytest_httpx/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/pytest_httpx-$pkgver"

build() {
	python3 -m build --no-isolation --wheel
}

check() {
	python3 -m installer -d testenv \
		dist/pytest_httpx-$pkgver-py3-none-any.whl
	local sitedir="$(python3 -c 'import site;print(site.getsitepackages()[0])')"
	#deselected tests fail on [b''] not equal to [] 
	PYTHONPATH="$PWD/testenv/$sitedir" python3 -m pytest \
		--deselect tests/test_httpx_async.py::test_default_response_streaming \
		--deselect tests/test_httpx_sync.py::test_default_response_streaming
}

package() {
	python3 -m installer -d "$pkgdir" \
		dist/pytest_httpx-$pkgver-py3-none-any.whl
}

sha512sums="
6be6fb39ad1ef233ce9be7cf510422754b6c97a1b565d49224e82cbe4218ee24051b6c5865215ed575f200446dfe8dd1470908467c67077c51a4f5412b113c2a  py3-pytest-httpx-0.21.0.tar.gz
"
